/* $Header: flow.h,v 2.2 01/10/02 10:30:22 przybyls Exp $ */

/***********************************************************************/
/* INCLUDE FILE NAME: flow.h                                           */
/* ==================                                                  */
/*                                                                     */
/* Author: wikfors                                                     */
/*                                                                     */
/* COMMENT:  This file contains function prototypes for the functions  */
/*           found in the library flow.a                               */
/*                                                                     */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#ifndef FLOW_H
#define FLOW_H

/*****************************/
/*   IFDEFS                  */
/*****************************/


/*****************************/
/*   SYMBOLIC CONSTANTS      */
/*****************************/


/*****************************/
/*   MACROS                  */
/*****************************/


/*****************************/
/*   TYPEDEFS                */
/*****************************/


/*****************************/
/*   FUNCTION PROTOTYPES     */
/*****************************/

  /* exports to startup.c */
extern void    DeterminePneuConfig( void );
extern U_INT16 CheckIfPcbIsAlive( void );
extern void    PneuStartup(void);
extern void    InitializePneumatics(void);
extern void    InitPneuConfig(void);
extern void    QueueInit( void );
#pragma SECTION PROG=boot
extern void    LinkPneuStructs( void );
#pragma SECTION UNDO

  /* exports to statmon */
void CheckForDeadPcb( void );
void ClearPneuExceptions( void );

void NonEpcPneuControl(void);
void PneuControl(void);
void PneuDisplay(void);
void SetPneuDefaultSetpts(void);
INT32 GetPreRunEquibTime( void );
void SolenoidValveDrive(void);
U_INT16 GetStandardPressure ( /*pCOLUMN_STATUS*/ void *status );


#if 0
U_INT16 CalcPiFromVFlow (U_INT32 v_flow, U_INT32 Oven_Temp, U_INT32 Po, /*pCOLUMN_STATUS*/ void *status );
U_INT32 CalcVFlow ( /*pCOLUMN_STATUS*/ void *status, U_INT32 Oven_Temp, U_INT16 P_inlet, U_INT16 Po );
#endif

#ifdef P_STATUS_H
void  SlamColumnSetpt  ( U_INT32 setpt,    pCOLUMN_STATUS   status );
void  SlamAuxPresSetpt ( U_INT16 pressure, pAUX_STATUS      status );
#endif

void *GetRampInfoPtr( /*pCOLUMN_STATUS*/ void *status );

    /* exports to detector */

void DetGasOFF ( POSITION position , U_INT8 gas );
void DetGasON ( POSITION position, U_INT8 gas );
void SetDetDutyCycle( POSITION position, U_INT8 gas, U_INT8 duty_cycle );
void SetDetGasIgnitionFlow( POSITION position, U_INT8 gas, U_INT32 flow );
void StartDetIgnitionSeq( POSITION position );
void EndDetIgnitionSeq( POSITION position );


    /* exports to keyboard */

BIT8 ReadEeprom( U_INT16 module, U_INT16 address, U_INT16 *value );
BIT8 WriteEeprom( U_INT16 module, U_INT16 address, U_INT16 value );
BIT8 PrimitiveWriteEeprom( U_INT16 module, U_INT16 address, U_INT16 value );
BIT8 PcbPeek( U_INT16 address, U_INT32 *value );
BIT8 PcbPoke( U_INT16 address, U_INT32 value );

   /* export to hostcommand diagnostic test */

BIT8 SendPcbCmd( U_INT16 *cmd_array, U_INT16 *resp_array );


   /* exports to run control */

void CheckInletReadinessAtStart(void);
void RequestFlowSensorAutoZero(void);

  /* exports to zones */

void ReadEepromThermalInfo ( U_INT16 module_number, U_INT16 *thermal_info );
void SendSaveInletThermalPidRequest( POSITION position, U_INT16 *thermal_info );
void SendReadInletThermalPidRequest( POSITION position, U_INT16 *thermal_info );
void SendSaveDetThermalPidRequest( POSITION position, U_INT16 *thermal_info );
void SendReadDetThermalPidRequest( POSITION position, U_INT16 *thermal_info );
void ClearThermalEepromModified( U_INT16 module_number );


#pragma SECTION PROG=prog

void PneuFatalError( U_INT16 soft, U_INT16 reason );

#pragma SECTION UNDO

#endif
